package com.ruoyi.common.utils;

import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import java.util.Collection;
import java.util.List;

/**
 * 邮件发送工具类
 * @author Wu Zhongfu
 */
public class EmailUtils
{
    public static void sendNoMultiEmail(JavaMailSender mailSender, String from, String to, String subject, String text) throws Exception {
        MimeMessage mimeMessage = mailSender.createMimeMessage();
        MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, false);
        helper.setSubject(subject);
        helper.setText(text);
        helper.setTo(to);
        helper.setFrom(from);
        mailSender.send(mimeMessage);
    }

}
